import time
from tkinter.tix import Select

from selenium import webdriver
from selenium.webdriver.common.by import By

# 1.打开浏览器

from selenium.webdriver.support.select import Select

# 创建浏览器对象
driver = webdriver.Chrome()
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")
# 放大浏览器页面
driver.maximize_window()

# 1).点击 alert 按钮
driver.find_element(By.CSS_SELECTOR, "#alerta").click()
# 2).关闭警告框
# 3).输入用户名：admin
driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("admin")


time.sleep(3)
driver.quit()